
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>wangEditor 获取内容</title>
</head>
<body>
    <div id="div3" name="message">
        
    </div>
    <div>
        <!--
        <button id="btn1">获取html</button>
        <button id="btn2">获取text</button>
    -->
         <input type="button" id="btn" value="关闭"/><br/>
    </div>
    
    <script type="text/javascript" src="wangEditor.min.js"></script>
    <script type="text/javascript">
        var E = window.wangEditor
        var editor2 = new E('#div3')
        editor2.create()

/*
        document.getElementById('btn1').addEventListener('click', function () {
            console.log(editor2.txt.html())
            alert(editor2.txt.html())
        }, false)

        document.getElementById('btn2').addEventListener('click', function () {
            alert(editor2.txt.text())
        }, false)
*/

            var btn = document.getElementById('btn');
            var message = document.getElementById('div3');
            btn.onclick = function(){
                var div = window.opener.document.getElementById('msg');
                div.innerHTML = editor2.txt.html();
                window.close();
            };   

    </script>


</body>
</html>